#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <thread>
#include <Windows.h>

using namespace std;

void threadrun(std::string name, int num)
{
	while (num--)
	{
		std::cout << name << "num: " << num << std::endl;
		Sleep(1000);
	}

}

void thread_2()
{
	int n = 5;
	while (n--)
	{
		cout << "thread2: " << n << endl;
	}
}

int main()
{
	std::thread thread1(threadrun, "thread1", 10);
	std::thread thread2(thread_2);

	thread1.join();
	thread2.join();

	return 0;
}